<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_居中测试</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        .main{
            background-color: #0aa1ed;
        }
        .card{
            width: 300px;
            height: 500px;
            border: 5px solid black;
            background-color: lime;
            text-align: center;/*文字水平居中*/
            line-height: 500px;/*文字垂直居中*/
            margin:0 auto;/*使用外间距使内容居中*/
        }
        .center{
            width: 1000px;
            margin:0 auto;
            background-color: yellow;
        }


    </style>
</head>
<body>
<div class="header">顶部条</div>
<div class="nav">导航栏</div>
<div class="main">
    <div class="center">
        <div class="card" >我是内容</div>
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>
    </div>
</div>
<div class="footer">底部条</div>
</body>
</html>